iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 27
0
自我挑戰組

iOS 筆記系列 第 27

什麼是 AppDelegate ? Part3

  • 分享至 

  • xImage
  •  

為什麼一個區區的 AppDelegate 我就要分成三個 part 呢?

因為基本上我最信任的是官方文件的解釋,如果現在的官方文件沒有再去看看有沒有舊的文件,如果舊的文件沒有,最後才去找網路上的說明,網路上的說明並不一定是對的,之前 super 系列就是個例子,大家討論的很熱烈,結果文件裡就寫在哪裡......

所以第三部分,就是我找些網路上我覺得還說得通的解釋。我找到兩個人的解釋:

1

Your application delegate is the heart of your application. It's effectively your "Program Controller".

The Application Delegate is the class that receives application-level messages, including the applicationDidFinishLaunching message most commonly used to initiate the creation of other views.

來源:http://stackoverflow.com/a/652496/3295047

2

Every iPhone application (for the normal scenarios) will have one and only one (singleton) object of type UIApplication. This provides some basic functionality for running and managing an application. This class is from the Cocoa Touch library. It is defined in UIApplication.h, which is part of the UIKit framework.

Now, there needs to be a way to add your own custom code to respond to some of the events that UIApplication is responding to. That’s where the delegate comes into play. This is typically setup as a connection from the Interface Builder.

來源:http://www.infinitezest.com/articles/application-delegate-for-the-first-iphone-application-explained.aspx

我想了解 AppDelegate 之旅就到此為止了,顯然更底層的事情都是蘋果會幫我們處理,所以蘋果也沒打算講太多。


上一篇
什麼是 AppDelegate?part2
下一篇
UICollectionView
系列文
iOS 筆記30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言